#pragma once
#include "dbbase.h"

#define MAX_GROUP_NAME 64

class CGroupsDb :
    public CDbBase
{
public:
    CGroupsDb(void);
    ~CGroupsDb(void);

    DWORD Open(void);
    DWORD Add(CString GroupName, UINT *pAssignedId);
    DWORD Get(UINT Index, UINT *pId, CString *pGroupName);
    DWORD GetFromId(UINT Id, CString *pGroupName, UINT *pIndex);

private:
    struct Record
    {
        UINT Id;
        TCHAR GroupName[MAX_GROUP_NAME];
    };

    static const TCHAR *DB_NAME;

    UINT m_MaxId;
};
